#!/usr/bin/perl  
$friend = Louise; # global variables 
$pal = Danny; 
print "$friend and $pal are global.\n" ; 

sub guests { 
my ($friend)= "Pat" ; # $friend is known only in this function 
local $pal= "Chris" ; # $pal is known in this function and functions 
#  called from here 
print "In guests subroutine:
$friend and $pal are welcome guests.\n" ;
&who_is_it; # call subroutine 
}  

sub who_is_it { 
print  "In who_is_it subroutine:
You still have your global friend, $friend, here.\n" ;
print "But your pal is now $pal.\n" ; # $pal can be changed here 
}  

&guests; #call subroutine
